//
//  LCCollectionWaterFlowLayout.h
//  lechuang
//
//  Created by Mr_hi on 2024/10/22.
//  Copyright © 2024 Mooyi. All rights reserved.
//

#import <UIKit/UIKit.h>

@class LCCollectionWaterFlowLayout;

@protocol LCCollectionWaterFlowLayoutDeletage <NSObject>

@required
//cell 高
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(LCCollectionWaterFlowLayout *)collectionViewLayout heightForRowAtIndexPath:(NSIndexPath *)indexPath itemWidth:(CGFloat)itemWidth;

@optional
// 头部的size
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(LCCollectionWaterFlowLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section;

// 尾部 的 size
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(LCCollectionWaterFlowLayout *)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section;

// 每个区的边距
- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(LCCollectionWaterFlowLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section;

// 每个区多少列
- (NSInteger)collectionView:(UICollectionView *)collectionView layout:(LCCollectionWaterFlowLayout *)collectionViewLayout columnNumberAtSection:(NSInteger )section;

// 每个区多少中行距
- (NSInteger)collectionView:(UICollectionView *)collectionView layout:(LCCollectionWaterFlowLayout *)collectionViewLayout lineSpacingForSectionAtIndex:(NSInteger)section;

// 每个 item 之间的左右间距
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(LCCollectionWaterFlowLayout*)collectionViewLayout interitemSpacingForSectionAtIndex:(NSInteger)section;

// 本区区头和上个区区尾的间距
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(LCCollectionWaterFlowLayout*)collectionViewLayout spacingWithLastSectionForSectionAtIndex:(NSInteger)section;

@end


@interface LCCollectionWaterFlowLayout : UICollectionViewFlowLayout

@property (nonatomic, weak) id<LCCollectionWaterFlowLayoutDeletage> delegate;

@property (nonatomic,assign) UIEdgeInsets sectionInsets;

@property (nonatomic,assign) NSInteger columnCount;

@property (nonatomic,assign) CGFloat lineSpacing;

@property (nonatomic,assign) CGFloat interitemSpacing;

@property (nonatomic,assign) CGSize headerReferenceSize;

@property (nonatomic,assign) CGSize footerReferenceSize;



@end

